package com.project_test.kun.travelling_1st.HomePage.category;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by Administrator on 16-10-17.
 */
public class HomePHouseListItem {

    private String name;
    private int hid;
    private int price;
    private int buy_type;
    private int max_person;
    private String address;
    private int scores;
    private String lng;
    private String lat;
    private String picture;

    public void  pashJsonObject(JSONObject json) throws JSONException {
//    "name": "乐聚派别墅轰趴馆，承接公司聚会，家庭聚会，同学聚会。",
        name = json.getString("name");
//            "hid": "21401",
        hid = json.optInt("hid");
//            "price": "1980.00",
        price = json.getInt("price");
//            "buy_type": "58",
        buy_type = json.optInt("buy_type");
//            "max_person": "18",
        max_person = json.getInt("max_person");
//            "address": "北京市房山区",
        address = json.getString("address");
//            "scores": "4.00",
        scores = json.getInt("scores");
//            "lng": "116.158233",
        lng = json.getString("lng");
//            "lat": "39.730491",
        lat = json.getString("lat");
//            "picture": "http://img1.handybest.com/Uploads/Hotel/920/16/08/579ef9aaf24f9.jpg!phone"
        picture = json.getString("picture");
    }

    public String getName() {
        return name;
    }

    public int getHid() {
        return hid;
    }

    public int getPrice() {
        return price;
    }

    public int getBuy_type() {
        return buy_type;
    }

    public int getMax_person() {
        return max_person;
    }

    public String getAddress() {
        return address;
    }

    public int getScores() {
        return scores;
    }

    public String getLng() {
        return lng;
    }

    public String getLat() {
        return lat;
    }

    public String getPicture() {
        return picture;
    }

    @Override
    public String toString() {
        return "HomePHouseListItem{" +
                "name='" + name + '\'' +
                ", hid=" + hid +
                ", price=" + price +
                ", buy_type=" + buy_type +
                ", max_person=" + max_person +
                ", address='" + address + '\'' +
                ", scores=" + scores +
                ", lng='" + lng + '\'' +
                ", lat='" + lat + '\'' +
                ", picture='" + picture + '\'' +
                '}';
    }
}